﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using RRRSRoguelikeData;

namespace RRRSRoguelike.Entities
{
    public class Sword : Tile
    {
        private int uses;
        private int maxUses;

        /// <summary>
        /// Constructor for sword. Contains hard code for 3 uses.
        /// </summary>
        /// <param name="position"></param>
        public Sword(Point position):base()
        {
            this.TileData = TileData.ReadTileDataFromXML(Properties.Settings.Default.CustomFolder + @"\Props\Sword.xml");
            this.Position = position;
            maxUses = 3;
        }

        public void Use(Player p)
        {
            uses++;

            if (uses >= maxUses)
                p.Inventory.Remove(this);
            
        }

        public int UsesRemaining
        {
            get { return maxUses-uses ; }
        }
    }
}
